package neuralModel.activationFunction;

public class RadialActivationFunction implements IActivationFunction
{

	double beta;
	public RadialActivationFunction(int centerCount, double maxDistance)
	{

		this.beta = -(centerCount / (maxDistance * maxDistance));
	}

	public double calcualteRadialDistance(double[] center, double[] dataPoint)
	{
		double[] differnece = new double[center.length];
		for (int i = 0; i < center.length; i++)
		{
			differnece[i] = dataPoint[i] - center[i];
		}

		double distance = 0;
		for (int i = 0; i < center.length; i++)
		{
			distance += differnece[i] * differnece[i];
		}

		double result = Math.exp(beta * distance);
		return result;
	}

	@Override
	public double calculateOutputValue(double inducedLocalField)
	{
		return 0;
	}

	@Override
	public double calculateDerivative(double inducedLocalField)
	{
		return 0;
	}

}
